package com.zmkj.service.Imp;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zmkj.dao.SysSubmitWorkDao;
import com.zmkj.dao.SysWorkDao;
import com.zmkj.domain.SubmitData;
import com.zmkj.domain.SysSubmitWork;
import com.zmkj.domain.SysWord;
import com.zmkj.service.SysSubmitWorkService;
import com.zmkj.utils.Code;
import com.zmkj.utils.Rest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class SysSubmitWorkServiceImp implements SysSubmitWorkService {

    @Autowired
    private SysSubmitWorkDao sysSubmitWorkDao;
    @Autowired
    private SysWorkDao sysWorkDao;

//    @Override
//    public Rest getSubmitWorkData(Integer userId) {
//        LambdaQueryWrapper<SysSubmitWork> submitWordWrapper = new LambdaQueryWrapper<>();
//        submitWordWrapper.eq(SysSubmitWork::getUserId,userId);
//        List<SysSubmitWork> sysSubmitWorkData = sysSubmitWorkDao.selectList(submitWordWrapper);
//        ArrayList<SubmitData> submitData = new ArrayList<>();
//        for(SysSubmitWork d : sysSubmitWorkData){
//            LambdaQueryWrapper<SysWord> WrokWrapper = new LambdaQueryWrapper<>();
//            WrokWrapper.eq(SysWord::getId,d.getWorkId());
//            SysWord sysWordData = sysWorkDao.selectOne(WrokWrapper);
//            SubmitData sd = new SubmitData();
//            sd.setWorkTitle(sysWordData.getWorkTitle());
//            sd.setSubmitNumber(d.getSubmitNum());
//            sd.setPyMethod(sysWordData.getPyMethod());
//            submitData.add(sd);
//        }
//        return new Rest(Code.rc200.getCode(),submitData,Code.rc200.getMsg());
//    }
}
